/*   Valhalla MailChecker -- Simple IMAP Mail Checker
*    Copyright (C) 2010-2011  Guillaume Florimond (gflorimond at gmail dot com)
*
*    This program is free software: you can redistribute it and/or modify
*    it under the terms of the GNU General Public License as published by
*    the Free Software Foundation, either version 3 of the License, or
*    any later version.
*
*    This program is distributed in the hope that it will be useful,
*    but WITHOUT ANY WARRANTY; without even the implied warranty of
*    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
*    GNU General Public License for more details.
*
*    You should have received a copy of the GNU General Public License
*    along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/

package fr.valhalla.mailcheck;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

/**
 *
 * @author guillaume
 */
public class ConsoleMode {

    public ConsoleMode() {

    }

    public static String readFromConsole(String question) {
        System.out.print(question + " ");
        // Ask for masterpassword and reads from console
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String answer = null;

        try {
            answer = br.readLine();
        } catch (IOException ioe) {
            System.out.println("FATAL ERROR : Could not read your answer. (Now quitting...).");
            System.exit(1);
        }

        return answer;
    }
}


